package zid

// ToolOmit 从list 中忽略后面的元素
func ToolOmit(list []ID, omit ...ID) []ID {
	for _, item := range omit {
		idx := ToolIndex(list, item)
		for idx != -1 {
			list = append(list[:idx], list[idx+1:]...)
			idx = ToolIndex(list, item)
		}
	}
	return list
}

func ToolIndex(list []ID, target ID) int {
	for idx, item := range list {
		if item == target {
			return idx
		}
	}
	return -1
}
